<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<title>余额记录</title>
		<script src="/public/static/index/js/mui.min.js"></script>
	    <link href="/public/static/index/css/mui.min.css" rel="stylesheet"/>
	    <link rel="stylesheet" href="/public/static/index/css/iconfont.css" />
	    <link rel="stylesheet" href="/public/index/css/style.css" />
	    <link rel="stylesheet" href="__INDEX__/css/yund.css" />
	    <style type="text/css">
	    	/*余额记录*/
.yue_top{background: #001929; padding: 1.5rem 8%;}
.yue_top p{line-height: normal; color: white; font-size: .85rem;}
.yue_top .yue_num{font-size: 2.5rem; margin-top: .8rem;}
.yue_list li{padding: 3%; display: table; width: 100%; background: white; border-bottom: 1px solid #EEEEEE;}
.yue_list li>div{display: table-cell; vertical-align: middle; width: 60%}
.yue_list li .yue_prinum{width: 40%; color: #FF0000; font-size: 1.1rem; text-align: right;}
.yue_list .type{font-size: .9rem; color: #333333; line-height: normal;}
.yue_list .time{font-size: .75rem; color: #999999; line-height: normal;}
.yue_list li .jian{color: #00940F;}
	    </style>
	</head>

	<body>
		<header class="mui-bar mui-bar-nav">
			<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left" href="JavaScript:history.go(-1)"></a>
			<h1 class="mui-title">余额记录</h1>
		</header>
		<div class="mui-content" style="padding-bottom: 0;">
			<div class="yue_top">
				<p class="tip">余额</p>
				<p class="yue_num">{$data.money}</p>
			</div>
			{if $list==null||count($list)==0}
	    	<img src="__INDEX__/no.jpg"/> 
	    	{/if}
			<ul class="yue_list">
				{volist name='list' id='vo' empty="没有数据"}
				<li>
					<div class="left">
						<p class="type">{$vo.message}</p>
						<p class="time">{$vo.add_time}</p>
					</div>
					<div class="yue_prinum">{$vo.balance}</div>
				</li>
				{/volist}
			</ul>
			<p id="over" style="display: none;text-align: center;">
				数据已经已经加载完
			</p>
		</div>
		<input type="hidden" id="page" value="1" /> {include file="public/footer" /}
	</body>
	<script>
		var load = true;

		$(window).scroll(function() {
			var scrollTop = $(this).scrollTop(); //滑过的文档高度  
			var scrollHeight = $(this).height(); //文档高度  
			var windowHeight = window.innerHeight; //浏览器窗口高度  
			if(($(window).scrollTop() + $(window).height() > $(document).height() - 10) && load) {
				var index = layer.load(0, {
					shade: false,
					time: 1.5 * 1000
				});
				$(".layui-layer-loading").css("left", "50%");
				load = false;
				$.ajax({
					type: "post",
					data: {
						page: parseFloat($("#page").val()) + 1
					},
					url: "{:url('index/member/yue_record')}",
					success: function(data) {
						layer.close(index);
						load = true;
						var list = data.list;
						var html = "";
						if(list && list.length > 0) {
							$("#page").val(parseFloat($("#page").val()) + 1);
							for(var i = 0; i < list.length; i++) {
								var vo = list[i];
								html += '<li>' +
									'<div class="left">' +
									'<p class="type">' + vo.order_type + '</p>' +
									'<p class="time">' + vo.add_time + '</p>' +
									'</div>' +
									'<div class="yue_prinum">' + vo.balance + '</div>' +
									'</li>';
							}
						} else {
							$("#over").show();
						}
						$(".yue_list").append(html);

					}
				});

			}
		})
	</script>

</html>